package com.example.exam.service.impl;

import com.example.exam.entity.Choice;
import com.example.exam.repository.ChoiceRepository;
import com.example.exam.service.ChoiceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;

/**
 * @author shishuqian
 * date 2021/5/3
 * time 21:51
 **/
@Service
public class ChoiceServiceImpl implements ChoiceService {

    @Autowired
    private ChoiceRepository choiceRepository;

    @Override
    public Choice findById(Integer id) {
        Optional<Choice> choice = choiceRepository.findById(id);

        return choice.orElse(null);
    }
}
